{include file="common/_meta" /}
<title></title>
</head>

<body>
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span>充值管理 <span class="c-gray en">&gt;</span> 充值订单 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a></nav>
    <div class="page-container">
        <div class="cl pd-5 bg-1 bk-gray mt-20">
            <!-- <a class="btn btn-primary radius" id="groupAdd" href="javascript:;"><i class="Hui-iconfont"></i> 添加红包</a> -->
            <span class="r">共有数据：<strong>{$list->total()}</strong> 条</span></div>
        <div class="mt-20">
            <table class="table table-border  table-hover table-bg table-sort">
                <thead>
                    <tr class="text-c">
                        <th width="25">
                            <input type="checkbox" name="" value="">
                        </th>
                        <th>编号</th>
                        <th>订单编号</th>
                        <th>会员|电话</th>
                        <th>订单金额</th>
                        <th>订单时间</th>
                        <th>充值冻结(天)</th>
                        <th>充值金额</th>
                        <th>冻结状态</th>
                        <th>充值状态</th>
                        <th width="10%">操&nbsp;&nbsp;&nbsp;&nbsp;作</th>
                    </tr>
                </thead>
                <tbody>
                    {volist name='list' id="vo"}
                    <tr class="text-c">
                        <td>
                            <input type="checkbox" value="1" name="">
                        </td>
                        <td>{$i}</td>
                        <td>{$vo.rec_num}</td>
                        <td>{$vo.username}|{$vo.mobile}</td>
                        <td>{$vo.rec_paper}</td>
                        <td>{$vo.rec_time}</td>
                        <td>{$vo.congel}</td>
                        <td>{$vo.sum}</td>
                        {if condition="$vo.con_status eq 1"}
                            <td>
                                <span class="label label-danger radius">冻结中</span>
                            </td>
                        {else/}
                            {if condition="$vo.congel"}
                                <td><span class="label label-success radius">已释放</span></td>
                            {else/}
                                <td></td>
                            {/if}
                        {/if}
                        {if condition="$vo.status eq 1"}
                            <td>
                                <span class="label label-success radius">已完成</span>
                            </td>
                            <td></td>
                        {else/}
                            <td>
                            <span class="label label-danger radius">未完成</span>
                            </td>
                            <td class="td-manage">
                                <a style="text-decoration:none" onClick="groupEdit(this,{$vo.id})" href="javascript:;" title="充值">充值</a>
                            </td>
                            {/if}
                    </tr>
                    {/volist}
                </tbody>
            </table>
            <div class="pages" style="margin:20px;float: right; ">{$list->render()}</div>
        </div>
        <!-- 添加、修改代理 -->
        <div id="agent_add" class="modal fade" style="margin: 0 auto;" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content radius">
                    <div class="modal-header">
                        <h3 class="modal-title"></h3>
                        <a class="close" data-dismiss="modal" aria-hidden="true" href="javascript:void();">×</a>
                    </div>
                    <div class="modal-body">
                        <article class="page-container" style="padding-right: 10%;">
                            <form action="" method="post" class="form form-horizontal" id="form-agent-add">
                                <div class="row cl hidden">
                                    <label class="form-label col-xs-4 col-sm-3"></label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="hidden" name="id" class="input-text" placeholder="" autocomplete="off" id="id" value="">
                                        <input type="hidden" name="uid" class="input-text" placeholder="" autocomplete="off" id="uid" value="">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">订单金额：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="rec_paper" class="input-text" placeholder="" autocomplete="off" id="rec_paper" disabled="true">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">冻结天数：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="congel" class="input-text" placeholder="" autocomplete="off" id="congel" value="2" >
                                    </div>
                                </div>
                                <div class="row cl">
                                    <label class="form-label col-xs-4 col-sm-3">充值：</label>
                                    <div class="formControls col-xs-8 col-sm-9">
                                        <input type="text" name="denom" class="input-text" placeholder="" autocomplete="off" id="denom">
                                    </div>
                                </div>
                                <div class="row cl">
                                    <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                                        <input class="btn btn-primary radius" type="submit" value="提交">
                                        <input class="btn btn-primary radius" type="reset" style="display: none;" id="rst">
                                    </div>
                                </div>
                            </form>
                        </article>
                    </div>
                </div>
            </div>
        </div>
    </div>
    {include file="common/_footer" /}
    <!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript">
    // 添加红包
    $("#form-agent-add").find('input:submit').click(function() {
        $.post("{:url('Recharge/index')}?acc=edit", $("#form-agent-add").serialize()).success(function(data) {
            layer.msg(data.msg);
            if (data.code) {
                setTimeout(function() {
                    history.go(0);
                }, 1000);
            }
        });
        return false;
    });

    // 编辑
    function groupEdit(obj, id) {
        $("#agent_add").modal("show");
        $.post("{:url('Recharge/index')}?acc=get", { id: id }, function(data) {
            if (data) {
                $('#id').val(data.id);
            	$('#uid').val(data.uid);
                $('#rec_paper').val(data.rec_paper);
            }
        });
    }

    $('#groupAdd').click(function () {
        $('#rst').click();
        $('#tel').attr('disabled', false);
        $('#name').attr('disabled', false);
        $("#agent_add").modal("show");
    })


$(function(){
  $('.table-sort').dataTable({
    "aaSorting": [[ 0, "desc" ]],//默认第几个排序
    "bStateSave": true,//状态保存
    "aoColumnDefs": [
      //{"bVisible": false, "aTargets": [ 3 ]} //控制列的隐藏显示
      {"orderable":false,"aTargets":[0,2,4]}// 制定列不参与排序
    ]
  });
});

    </script>
</body>

</html>